<template>
    <div>
        <!-- <input type="text" :value='value' @input='fn'> -->
        <input type="text" v-model='qqq' @keydown.enter='fn2'>
    </div>
</template>
<script>
// @ is an alias to /src
export default {
    name: 'my-input',
    props:['value'],
    data() {
        return {
        
        }
    },
    methods: {
        fn(e){
            // e.target.value 就是当前文本框的内容
            this.$emit('input',e.target.value)
        },
        fn2(){
            this.$emit('submit',this.qqq)
        }
    },
    computed: {
        qqq:{
            get(){
                return this.value
            },
            set(val){
                this.$emit('input',val)
            }
        }
    },
    components: {
        
    }
}
</script>
<style lang="less">

</style>